Diversity of fish, vulnerable species, and species of Outstanding Universal Value in Marine World Heritage Sites
This notebook explores species diversity in Marine World Heritage Sites using OBIS data. This is work in progress.
How to use this notebook
Optionally remove the following cache files before running the notebook:
occurrence.Rdata: occurrences by sitebold.Rdata: statistics on barcode sequences in BOLD for all fish species
If necessary, adjust fish taxonomy below:
fish_classes <- c("Actinopteri", "Cephalaspidomorphi", "Myxini", "Petromyzonti", "Elasmobranchii", "Holocephali", "Coelacanthi")
fish_orders <- c("Cetomimiformes", "Gasterosteiformes", "Scorpaeniformes", "Stephanoberyciformes")Other resources
A separate repository has been set up for compiling species list based on existing publications, see https://github.com/iobis/mwhs-species-lists.
Dependencies
library(dplyr)
library(caspr)
library(rredlist)
library(knitr)
library(ggplot2)
library(sf)
library(mapview)
library(concaveman)
library(sfheaders)
library(purrr)
library(robis)
library(stringr)
library(ftplottools)
library(ggrepel)Compiling a list of all WoRMS species including IUCN Red List category and BOLD barcode statistics
First read all accepted WoRMS species. As it’s not possible to get a full species list from the WoRMS or GBIF web services, I’m reading directly from an export provided by the WoRMS team. The list of fish classes and orders above is used to determine if species are fish or not.
worms <- read.csv("data/taxon.txt", sep = "\t", quote = "") %>%
as_tibble() %>%
filter(taxonRank == "Species" & taxonomicStatus == "accepted") %>%
select(taxonID, scientificName, phylum, class, order) %>%
distinct() %>%
mutate(is_fish = class %in% fish_classes | order %in% fish_orders) %>%
mutate(aphiaID = as.integer(str_replace(taxonID, "urn:lsid:marinespecies.org:taxname:", "")))Assign Red List categories
Here I’m using the rredlist package to get all Red List species from IUCN. Only the extinct and threatened categories are kept: CR, EN, VU, EW, EX.
get_redlist_species <- function() {
redlist <- tibble()
page <- 0
while (TRUE) {
res <- rl_sp(page, key = "a936c4f78881e79a326e73c4f97f34a6e7d8f9f9e84342bff73c3ceda14992b9")$result
if (length(res) == 0) {
break
}
redlist <- bind_rows(redlist, res)
page <- page + 1
}
redlist <- redlist %>%
as_tibble() %>%
filter(category %in% c("CR", "EN", "VU", "EW", "EX")) %>%
mutate(category = factor(category, levels = c("EX", "EW", "CR", "EN", "VU"))) %>%
group_by(scientific_name) %>%
filter(row_number() == 1) %>%
ungroup()
return(redlist)
}
redlist <- get_redlist_species()Now we can label Red List species in the worms data frame.
worms <- worms %>%
left_join(redlist %>% select(scientific_name, category), by = c("scientificName" = "scientific_name"))Get BOLD barcode statistics for all fish species
Let’s check BOLD for barcode sequences using all fish species in WoRMS:
# fixes issue with bold package
invisible(Sys.setlocale("LC_ALL", "C"))
if (!file.exists("bold.Rdata")) {
fish_species <- worms %>% pull(scientificName) %>% unique()
bold_list <- sapply(fish_species, function(x) NULL)
for (i in 1:length(bold_list)) {
message(i, " ", names(bold_list)[i])
if (is.null(bold_list[[i]])) {
bold_list[[i]] <- tryCatch({
caspr::bold_statistics(names(bold_list)[i])
}, warning = function(warning_condition) {
}, error = function(error_condition) {
}, finally = {
})
}
}
save(bold_list, file = "bold.Rdata")
} else {
load("bold.Rdata")
}
sequence_numbers <- unlist(map(bold_list, nrow))
fish_sequences <- tibble(species = names(sequence_numbers), sequences = sequence_numbers) %>%
filter(sequences > 0)
worms <- worms %>%
left_join(fish_sequences, by = c("scientificName" = "species"))Statistics
Now calculate some statistics:
worms %>%
summarize(
species = n(),
fish = sum(is_fish),
vulnerable = length(na.omit(category)),
vulnerable_fish = sum(is_fish * !is.na(category)),
barcode_fish = sum(sequences > 0, na.rm = T)
) %>%
kable(format.args = list(big.mark = ","))| species | fish | vulnerable | vulnerable_fish | barcode_fish |
|---|---|---|---|---|
| 222,644 | 20,122 | 1,471 | 855 | 9,534 |
Note that these numbers are slightly inflated due to homonyms, even after removing unaccepted names.
ggplot(worms %>% filter(!is.na(category))) +
geom_bar(aes(x = phylum, fill = category)) +
coord_flip() +
scale_fill_viridis_d(direction = -1)Marine World Heritage Sites statistics
In this section we will look at the diversity of fish and vulnerable species in each marine World Heritage site.
Fetch spatial data
First fetch the Marine World Heritage Sites shapefile from MarineRegions:
if (!file.exists("data/shape/worldheritagemarineprogramme.shp")) {
download.file("http://geo.vliz.be/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=MarineRegions:worldheritagemarineprogramme&outputformat=SHAPE-ZIP", "data/shape.zip")
unzip("data/shape.zip", exdir = "shape")
}
shapes <- st_read("data/shape/worldheritagemarineprogramme.shp") %>%
select(full_name, country, geometry) %>%
mutate(full_name = iconv(full_name, "latin1", "UTF-8"))## Reading layer `worldheritagemarineprogramme' from data source
## `/Users/pieter/Dropbox (IPOfI)/werk/projects/MWHS/notebook-mwhs/data/shape/worldheritagemarineprogramme.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 129 features and 15 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -55.00039 xmax: 180 ymax: 71.80583
## Geodetic CRS: WGS 84
Let’s create a map.
mapviewOptions(fgb = FALSE)
mapview(shapes)@map